
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Overview of Ambient Module &#8212; Texas A&amp;M Oil spill / Outfall Calculator 2.1.0 documentation</title>
    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="ambient.Profile" href="../autodoc/ambient/ambient.Profile.html" />
    <link rel="prev" title="seawater.cp" href="../autodoc/seawater/seawater.cp.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="overview-of-ambient-module">
<h1>Overview of Ambient Module<a class="headerlink" href="#overview-of-ambient-module" title="Permalink to this headline">¶</a></h1>
<dl class="field-list simple">
<dt class="field-odd">Release</dt>
<dd class="field-odd"><p>2.1</p>
</dd>
<dt class="field-even">Date</dt>
<dd class="field-even"><p>Jun 05, 2020</p>
</dd>
</dl>
<span class="target" id="module-ambient"></span><div class="section" id="ambient-module">
<h2>Ambient Module<a class="headerlink" href="#ambient-module" title="Permalink to this headline">¶</a></h2>
<p>Define functions, classes, and methods to handle ambient seawater data</p>
<p>This module defines functions to read in arbitrary format ambient data files
(e.g., CTD profiles), manipulate the data to extract profiles with monotonic
depth coordinate values, and adjust parameter units to standard units. It also
defines functions and classes to store the measured CTD data in
netCDF4-classic format following NODC guidelines and to manipulate the data
for use by simulation models in <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>. These manipulations include
interpolation methods, the ability to add or remove data from the database,
including the addition of synthetic data when needed, and to extend a profile
to deeper depths using a rational means of maintaining the stratification
structure.</p>
<p>These methods are particularly useful to rapidly create ambient profile 
databases for use by <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code> and for archiving data obtained from arbitrary 
formats in standard format netCDF4-classic files.  These methods also allow
seamless coupling of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code> simulation modules with general ocean 
circulation models or Lagrangian particle tracking models that store their 
seawater properties data in netCDF format.</p>
<p>In its original design, the <cite>ambient</cite> module required all <cite>Profile</cite> objects 
to be stored as netCDF datasets.  In the present version, this requirement
has been removed so that <cite>Profile</cite> objects can be created from other input
data types and without storing the data as a netCDF dataset.  The original
functionality of the <cite>Profile</cite> class, however, is the same, so that seamless
integration with other other <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code> modules is maintained.</p>
<div class="section" id="see-also">
<h3>See Also<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h3>
<dl class="simple">
<dt><cite>netCDF4</cite><span class="classifier"></span></dt><dd><p>Package for creating and manipulating netCDF datasets</p>
</dd>
<dt><cite>datetime</cite><span class="classifier"></span></dt><dd><p>Package to create and manipulate dates</p>
</dd>
<dt><cite>numpy.fromfile</cite> :</dt><dd><p>Read data from a simple text file in single table format. Similar to the
Matlab <cite>load</cite> function. Does not support comments or skipped lines. Works
for text or binary files.</p>
</dd>
<dt><cite>numpy.loadtxt</cite><span class="classifier"></span></dt><dd><p>A more sophisticated method to read data from a text file. This method can
handle multiple data types (e.g., strings, floats, and integers together),
can perform transformation on the data (e.g., date format to a date
object), and can unpack to a tuple of variables. One limitation is that
all rows must have the same number of columns and there is no method to
handle missing data.</p>
</dd>
<dt><cite>numpy.genfromtxt</cite><span class="classifier"></span></dt><dd><p>The most advanced numpy method to read data from a file. Includes the
capabilities in <cite>numpy.loadtxt</cite>, but also allows for missing data, data
flags, and multiple methods to replace missing data or flags.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="class-objects-and-methods">
<h2>Class Objects and Methods<a class="headerlink" href="#class-objects-and-methods" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.html#ambient.Profile" title="ambient.Profile"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile</span></code></a>(data[, ztsp, chem_names, err, …])</p></td>
<td><p>Class object for ambient seawater profiles</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.get_values.html#ambient.Profile.get_values" title="ambient.Profile.get_values"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.get_values</span></code></a>(self, z, names)</p></td>
<td><p>Return values for the variables listed in <cite>names</cite> interpolated to the depth given by <cite>z</cite></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.get_units.html#ambient.Profile.get_units" title="ambient.Profile.get_units"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.get_units</span></code></a>(self, names)</p></td>
<td><p>Return a list of units for the variables in <cite>names</cite></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.append.html#ambient.Profile.append" title="ambient.Profile.append"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.append</span></code></a>(self, data, var_symbols, …)</p></td>
<td><p>Add data to the netCDF dataset and update the object attributes</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.buoyancy_frequency.html#ambient.Profile.buoyancy_frequency" title="ambient.Profile.buoyancy_frequency"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.buoyancy_frequency</span></code></a>(self, z[, h])</p></td>
<td><p>Calculate the local buoyancy frequency</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.extend_profile_deeper.html#ambient.Profile.extend_profile_deeper" title="ambient.Profile.extend_profile_deeper"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.extend_profile_deeper</span></code></a>(self, z_new[, …])</p></td>
<td><p>Extend the CTD profile to the depth <cite>z_new</cite> using a fixed buoyancy frequency</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.Profile.close_nc.html#ambient.Profile.close_nc" title="ambient.Profile.close_nc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Profile.close_nc</span></code></a>(self)</p></td>
<td><p>Close the netCDF dataset</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="module-functions">
<h2>Module Functions<a class="headerlink" href="#module-functions" title="Permalink to this headline">¶</a></h2>
<div class="section" id="functions-for-working-with-netcdf-files">
<h3>Functions for Working With NetCDF Files<a class="headerlink" href="#functions-for-working-with-netcdf-files" title="Permalink to this headline">¶</a></h3>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.create_nc_db.html#ambient.create_nc_db" title="ambient.create_nc_db"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_nc_db</span></code></a>(nc_file, summary, source, …)</p></td>
<td><p>Create an empty netCDF4-classic dataset to store ambient data</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.fill_nc_db.html#ambient.fill_nc_db" title="ambient.fill_nc_db"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fill_nc_db</span></code></a>(nc, data, var_symbols, var_units, …)</p></td>
<td><p>Add data to a netCDF4-classic ambient profile dataset</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.extract_profile.html#ambient.extract_profile" title="ambient.extract_profile"><code class="xref py py-obj docutils literal notranslate"><span class="pre">extract_profile</span></code></a>(data[, z_col, z_start, …])</p></td>
<td><p>Function to extract a CTD profile with monotonically increasing depth</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="functions-for-working-with-np-array-profiles">
<h3>Functions for Working With np.array() Profiles<a class="headerlink" href="#functions-for-working-with-np-array-profiles" title="Permalink to this headline">¶</a></h3>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.add_data.html#ambient.add_data" title="ambient.add_data"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_data</span></code></a>(data, col, var, new_data, …)</p></td>
<td><p>Add data to a <cite>numpy</cite> array</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.get_world_ocean.html#ambient.get_world_ocean" title="ambient.get_world_ocean"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_world_ocean</span></code></a>([Ts, Ss])</p></td>
<td><p>Load the world ocean average CTD data</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.load_raw.html#ambient.load_raw" title="ambient.load_raw"><code class="xref py py-obj docutils literal notranslate"><span class="pre">load_raw</span></code></a>(fname)</p></td>
<td><p>Read data from a text file.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="functions-for-modifying-profile-data">
<h3>Functions for Modifying Profile Data<a class="headerlink" href="#functions-for-modifying-profile-data" title="Permalink to this headline">¶</a></h3>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.coarsen.html#ambient.coarsen" title="ambient.coarsen"><code class="xref py py-obj docutils literal notranslate"><span class="pre">coarsen</span></code></a>(raw[, err])</p></td>
<td><p>Reduce the size of a raw database for interpolation</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.stabilize.html#ambient.stabilize" title="ambient.stabilize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">stabilize</span></code></a>(raw)</p></td>
<td><p>Force the density profile to be stable or neutral</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.compute_pressure.html#ambient.compute_pressure" title="ambient.compute_pressure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">compute_pressure</span></code></a>(z, T, S, fs_loc)</p></td>
<td><p>Compute the pressure profile by integrating the density</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../autodoc/ambient/ambient.convert_units.html#ambient.convert_units" title="ambient.convert_units"><code class="xref py py-obj docutils literal notranslate"><span class="pre">convert_units</span></code></a>(data, units)</p></td>
<td><p>Convert the values in data to standard units</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../index.html">Texas A&M Oil spill / Outfall Calculator</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../user_manual.html">TAMOC User Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../unit_tests.html">Unit Tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../readme.html">Read Me File</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="../index.html">Documentation overview</a><ul>
  <li><a href="../user_manual.html">TAMOC User Manual</a><ul>
      <li>Previous: <a href="../autodoc/seawater/seawater.cp.html" title="previous chapter">seawater.cp</a></li>
      <li>Next: <a href="../autodoc/ambient/ambient.Profile.html" title="next chapter">ambient.Profile</a></li>
  </ul></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2020, Scott A. Socolofsky.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="../_sources/modules/ambient.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>